{% extends 'base.html' %}
{% load mytags %}
{% load staticfiles %}
{% block title %}资产详细{% endblock %}
{% block css %}

  <!-- Theme style -->
  <link rel="stylesheet" href="{% static 'dist/css/AdminLTE.min.css' %}">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="{% static 'dist/css/skins/_all-skins.min.css' %}">

{% endblock %}

{% block content %}

    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        资产详细
        <small>asset info</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li>资产总表</li>
        <li class="active">资产详细</li>
      </ol>
    </section>



    <div class="row">
      <div class="col-xs-6">
          <div class="box-body">
              <div class="ibox-content ibox-heading">
                  <small><i class="fa fa-map-marker"></i> 此主机详细信息.</small>
              </div>
              <div class="ibox-content">
                <div class="text-left">
                  <table class="table table-striped table-bordered table-hover ">
                    <tr>

                      <td class="text-center">主机名</td>

                      <td>{{ asset.hostname }}
                          {%  if admin %}
                                <a href=" /admin/assets/asset/{{ asset.pk }}/change/" class="font-light" >修改</a>
                            {% endif %}
                      </td>

                    </tr>
                    <tr>
                      <td class="text-center">IP</td>
                      <td>{{ asset.ipadd }}</td>
                    </tr>
                    <tr>
                      <td class="text-center">设备类型</td>
                      <td>{{ asset.get_asset_type_display }}</td>
                    </tr>


                    <tr>
                      <td class="text-center">序列号</td>
                      <td>{{ asset.sn }}</td>
                    </tr>


                    <tr>
                      <td class="text-center">区域</td>
                      <td>{{ asset.area.name }}</td>
                    </tr>

                    <tr>
                      <td class="text-center">CPU</td>
                      <td>{{ asset.cpu }}</td>
                    </tr>
                    <tr>
                      <td class="text-center">磁盘</td>
                      <td>{{ asset.disk }}</td>
                    </tr>
                    <tr>
                      <td class="text-center">内存</td>
                      <td>{{ asset.memory }}</td>
                    </tr>
                    <tr>
                      <td class="text-center">备注</td>
                      <td>{{ asset.describe }}</td>
                    </tr>
                  </table>

                </div>
              </div>
          </div>
      </div>
      <div class="col-xs-6">
        <div class="box-body">
            <div class="ibox-content ibox-heading">
                <small><i class="fa fa-map-marker"></i> 此主机操作记录</small>
            </div>
            <div class="ibox-content">
              <div class="text-left">
                <table class="table table-striped table-bordered table-hover ">
                    {% for log in asset_logs%}
                    <tr>
                      <td class="text-center">操作用户</td>
                      <td>{{ log.user.username }}</td>
                    </tr>
                    <tr>
                      <td class="text-center">操作类型</td>
                      <td>{{ log.action_flag }}</td>
                    </tr>
                    <tr>
                      <td class="text-center">操作时间</td>
                      <td>{{ log.action_time|date:"Y-m-d H:i:s" }}</td>
                    </tr>
                    <tr>
                      <td class="text-center">变更日志</td>
                      <td>{{ log.change_message }}</td>
                    </tr>
                    <tr>
                      <td style="background-color: yellowgreen"></td>
                      <td style="background-color: yellowgreen"></td>
                    </tr>
                    {% endfor %}
                </table>
                <hr style="border:1 dashed #987cb9" width="80%" color=#987cb9 SIZE=1>
              </div>
            </div>

    </div>
  </div>

<!--     <h3>{{ asset.hostname }}</h3>
    {% for log in asset_logs %}
      <p>{{ log.user.username }}</p>
      <p>{{ log.action_flag }}</p>
      <p>{{ log.action_time|date:"Y-m-d H:i:s" }}</p>
      <p>{{ log.change_message }}</p>
    {% endfor %}
 -->
{% endblock %}

{% block script %}
    <!-- SlimScroll -->
    <script src="{% static 'bower_components/jquery-slimscroll/jquery.slimscroll.min.js' %}"></script>
    <!-- FastClick -->
    <script src="{% static 'bower_components/fastclick/lib/fastclick.js' %}"></script>

    <!-- AdminLTE for demo purposes -->
    <script src="{% static 'dist/js/demo.js' %}"></script>
    <!-- page script -->
{% endblock %}

